package com.chixing.day06_static.static_demo;


public class Student {
static {
    System.out.println("代码块1");
}
    public static int a = 10;   //类变量 Student.a  [共享数据区]
    public static Student stu = new Student();  //格式和  public static int a = 10;   一样
               //Student 引用数据雷影变量
    public int b;            //b = 0
    public int c = 20;      //实例变量 Student stu1 = new Student();  stu1.b
                            //实例变量 Student stu1 = new Student();  stu2.b

    static {
        System.out.println("代码块2");
    }

    public Student(){
        System.out.println("构造函数访问b = " + b);
        System.out.println("构造函数访问c = " + c);
        System.out.println("Student 无参构造函数");
    }

    //构造快。普通代码块（几乎不用）初始化对象的功能
    {
        System.out.println("构造快11");
        System.out.println("构造函数访问b = " + b);
        System.out.println("构造函数访问c = " + c);
    }
}
